package com.songcha.module_splash

import android.app.Application
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.songcha.library_business.provider.IApplicationInitProvider
import com.songcha.library_common.BuildConfig
import com.songcha.library_common.LibraryCommon
import com.songcha.library_common.util.PackageUtil
import com.umeng.commonsdk.UMConfigure

@Route(path="/splash/AppInitImpl")
class ModuleSplashApplication : Application(),IApplicationInitProvider {
    companion object{
        lateinit var mContext:Context

        @JvmStatic
        fun init(application:Application){
            mContext=application
            UMConfigure.preInit(application,application.resources.getString(R.string.umeng_appkey),PackageUtil.getUmengChannelName(application))
        }
    }

    override fun onCreate() {
        super.onCreate()
        ModuleSplashApplication.init(this)

        LibraryCommon.init(this)

        if(BuildConfig.DEBUG){
            ARouter.openLog()
            ARouter.openDebug()
        }

        ARouter.init(this)

    }

    override fun initApplication(application: Application) {
        //init(application)
        ModuleSplashApplication.init(application)
    }

    override fun init(context: Context?) {

    }


}